﻿using CommunityToolkit.Mvvm.Messaging;
using FanaticRock.Core.Extensions;
using FanaticRock.Events;
using FanaticRock.Theme.Enums;

namespace FanaticRock.Helpers
{
    internal class NoticeHelper
    {
        public static void Notice(NoticeEnum noticeType, string title, string content)
        {
            var args = new AppMessageEventArgs()
            {
                NoticeType = noticeType,
                Type = AppMessageEventArgs.MessageType.Message,
                Content = content,
                Title = title,
            };

            WeakReferenceMessenger.Default.Send(args);

            LogExtension.Info($"NoticeHelper.Notice: {noticeType} {title} {content}");
        }

        public static void Notice(NoticeEnum noticeType, string content)
        {
            var title = string.Empty;
            switch (noticeType)
            {

                case NoticeEnum.Info:
                    title = "消息";
                    break;
                case NoticeEnum.Warning:
                    title = "警告";
                    break;
                case NoticeEnum.Error:
                    title = "错误";
                    break;
                default:
                    break;
            }
            Notice(noticeType, title, content);
        }

        public static void Notice(string content)
        {
            Notice(NoticeEnum.Info, content);
        }

        public static void Notice(string title, string content)
        {
            Notice(NoticeEnum.Info, title, content);
  
        }

    }
}
